"use strict";
var DocsWithProjectDto = (function () {
    function DocsWithProjectDto() {
    }
    DocsWithProjectDto.toReturn = function (project, groups, docs) {
        var res = {
            projectId: project._id,
            title: project["title"],
            description: project["description"],
            groups: []
        };
        for (var i = 0; i < groups.length; i++) {
            var g = groups[i];
            var g_ = {
                _id: g._id,
                name: g.name,
                description: g.description,
                docs: []
            };
            for (var m = 0; m < docs.length; m++) {
                var doc = docs[m];
                if (doc.group["_id"] + "" === g._id + "") {
                    g_.docs.push(doc);
                }
            }
            res.groups.push(g_);
        }
        return res;
    };
    return DocsWithProjectDto;
}());
exports.DocsWithProjectDto = DocsWithProjectDto;
